<?php
defined('BASEPATH') OR exit('No direct script access allowed');


use QCloud_WeApp_SDK\Mysql\Mysql as DB;


class CartList extends CI_Controller
{
    public function index()
    {
        $unionid = $_GET['unionid'];
        $rows = null;
        if($unionid){
            $rows = DB::select('cc_cart', ['*'], ['unionid' => $unionid]);

        }
        if ($rows) {
            $this->json([
                'code' => 0,
                'data' => $rows
            ]);
        } else {
            $this->json([
                'code' => -1,
                'error' => $rows['error']
            ]);
        }
    }
}
